from  django.shortcuts import render,HttpResponse
from utils.tencent.sms import send_sms_single
import random

def send_sms(request):
    '''' 发送短信'''

    code = random.randrange(1000, 9999)
    res = send_sms_single('13611283287', 548760, [code, ])
    if res['result'] == 0:
        return HttpResponse('哈哈！成功了')
    else:
        return HttpResponse(res['errmsg'])
    # print(res)
    return HttpResponse('哈哈，成功')

